/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;
import java.io.Serializable;
import java.util.ArrayList;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
/**
 *
 * @author arcunni
 */

@Named(value = "cartBean")
@SessionScoped
public class CartBean implements Serializable {
    private ArrayList<PropertyBean> properties;
    private int count;
    
    public CartBean() {
        properties = new ArrayList();
        count = 0;
    }

    public ArrayList<PropertyBean> getProperties() {
        return properties;
    }

    public void setProperties(ArrayList<PropertyBean> properties) {
        this.properties = properties;
    }
    
    public void addProperty(PropertyBean newProp) {
        properties.add(newProp);
        count++;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }
    
    public void removeProperty(PropertyBean delProp) {
        properties.remove(delProp);
        count--;
    }
}
